
package com.studiofortress.sf.graphics;

/**
 * This is a stack of matrix operations. Transformations can be pushed onto the
 * stack and popped. This allows more transformations to be placed then your (or
 * older) graphics cards allow.
 *
 * This only stores and calculates the transformation values on the stack. It
 * does not make any OpenGL calls to apply them.
 * 
 * @author Joseph Lenton - JosephLenton@StudioFortress.com
 */
class MatrixStack
{
    private int size;
    
    /**
     * Trivial constructor creating a new stack.
     */
    public MatrixStack()
    {
        size = 0;
    }

    public void pushRotation(float angle)
    {
        pushRotation( angle, 0f, 0f );
    }
    
    public void pushRotation(float angleX, float angleY, float angleZ)
    {
        // TODO
    }

    public void pushTranslation(float x, float y)
    {
        pushTranslation( x, y, 0f );
    }
    
    public void pushTranslation(float x, float y, float z)
    {
        // TODO
    }
    
    public void pushScale(float scale)
    {
        pushScale( scale, scale );
    }
    
    public void pushScale(float x, float y)
    {
        // TODO
    }
    
    public void pop()
    {
        if (size() == 0) {
            throw new IllegalStateException("Cannot pop when there are no elements on the stack.");
        }

        // TODO
    }
    
    public void popTo(int index)
    {
        if (index < 0 || index >= size()) {
            throw new ArrayIndexOutOfBoundsException( index );
        }

        // TODO
    }

    public int size()
    {
        return size;
    }
}
